home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16232 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: 9 Apr 1996 20:56:07 -0500
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4kf4fn$bsr@solutions.solon.com>
  8. References: <JSA.96Feb16135027@organon.com> <dewar.829054330@schonberg> <4ke0ciINNgg8@keats.ugrad.cs.ubc.ca> <EACHUS.96Apr9184019@spectre.mitre.org>
  9. Reply-To: seebs@solon.com
  10. NNTP-Posting-Host: solutions.solon.com
  11.  
  12. In article <EACHUS.96Apr9184019@spectre.mitre.org>,
  13. Robert I. Eachus <eachus@spectre.mitre.org> wrote:
  14. >    I hope that everyone following this thread knows that this
  15. >"undefined" behavior lead to one of the security holes exploited by
  16. >the Morris Internet worm.
  17.  
  18. No, it quite definitely isn't.  The worm mostly used the function gets().
  19.  
  20. >    Undefined only means unusable in some contexts, and if the C read
  21. >had a way to know the size of the buffer passed, that particular
  22. >security hole would not have existed.
  23.  
  24. C does not have a read() function.  read() is a feature of Unix or
  25. POSIX-like systems.
  26.  
  27. The worm bug had nothing to do with the vague semantics of read.  (I've
  28. talked about this with Robert.  I still believe the code was incorrect,
  29. and he does not deny this, but I would have to say that he's right -
  30. the standard should be explicit about the requirements of read(), and
  31. the C standard should likewise be specific about the requirements of
  32. the buffer passed to fgets(), et al.)
  33.  
  34. The bug that caused the worm to be dangerous was that gets() has no
  35. way of determining that there are buffer problems.  Good implementations
  36. will give you a diagnostic message if you use gets().
  37.  
  38. (Well, NetBSD does.)
  39.  
  40. -s
  41. -- 
  42. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  43. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  44. FUCK the communications decency act.  Goddamned government.  [literally.]
  45. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  46.